package gat.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 支付方式
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum PayModeEnum {

    aliPc("aliPc", "支付宝pc扫码"),
    aliH5("aliH5", "支付宝h5"),
    aliApp("aliApp", "支付宝app"),
    aliApplet("aliApplet", "支付宝小程序"),
    wxPc("wxPc", "微信pc"),
    wxH5("wxH5", "微信h5"),
    wxApp("wxApp", "微信app"),
    wxApplet ("wxApplet", "微信小程序"),
    ;

    private String flag;
    private String desc;

    public static PayModeEnum getByFlag(String flag) {
        for (PayModeEnum payModeEnum : values()) {
            if (payModeEnum.getFlag().equals(flag)) {
                return payModeEnum;
            }
        }
        return null;
    }
}
